package com.ma5d.driver.driver.client;

import ch.qos.logback.core.spi.ConfigurationEvent;
import com.ma5d.driver.common.result.Result;
import com.ma5d.driver.model.form.DriverFaceModelForm;
import com.ma5d.driver.model.form.UpdateDriverAuthInfoForm;
import com.ma5d.driver.model.vo.driver.DriverLicenseOcrVo;
import com.ma5d.driver.model.vo.driver.DriverLoginVo;
import com.ma5d.driver.model.vo.driver.IdCardOcrVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = "service-driver")
public interface DriverInfoFeignClient {
    @GetMapping("/driver/info/login/{code}")
    Result<String> login(@PathVariable String code);

    @GetMapping("/driver/info/getDriverLoginInfo/{driverId}")
    Result<DriverLoginVo> getDriverLoginInfo(@PathVariable Long driverId);

    @PostMapping(value = "/ocr/idCardOcr", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<IdCardOcrVo> idCardOcr(@RequestPart("file") MultipartFile file);

    @PostMapping(value = "/ocr/driverLicenseOcr", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<DriverLicenseOcrVo> driverLicenseOcr(@RequestPart("file") MultipartFile file);

    @PostMapping(value = "/driver/info/updateDriverAuthInfo")
    Result<Boolean> updateDriverAuthInfo(@RequestBody UpdateDriverAuthInfoForm updateDriverAuthInfoForm);

    @PostMapping(value = "/driver/info/createDriverFaceModel")
    Result<Boolean> createDriverFaceModel(@RequestBody DriverFaceModelForm driverFaceModelForm);
}
